#' Build Custom Firefox profile
#'
#' Profile is an internal function used by \code{\link{individual_swims}}
#'
#'Profile is an internal function used by \code{\link{individual_swims}}. It prepares a Firefox profile so that the Top Times report generated by \code{\link{individual_swims}} can be downloaded as a \emph{.csv} without any human interaction. It is a wraper around \code{\link[RSelenium]{makeFirefoxProfile}}.
#'
#' @keywords internal
#'
#' @param downlaodPath a character string with a file path.
#'
#' @seealso \code{\link{individual_swims}} \code{\link[RSelenium]{makeFirefoxProfile}}
profile <- function(downloadPath){
fprof <- RSelenium::makeFirefoxProfile(list(
browser.download.folderList = 2L,
browser.download.manager.showWhenStarting = FALSE,
browser.download.dir = downloadPath,
browser.helperApps.neverAsk.openFile = "application/excel",
browser.helperApps.neverAsk.saveToDisk = "application/excel",
browser.helperApps.alwaysAsk.force = FALSE,
browser.download.manager.showAlertOnComplete = FALSE,
browser.download.manager.closeWhenDone = TRUE )
)
return(fprof)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.